<template>
  <div class="photo">
    <img
      src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/9e46fbd82937590e86ee3368c2a2adaf.jpg"
      alt=""
    />
    <div class="small">
      <Banners :banners="data"></Banners>
    </div>
    <img
      src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/f835c4b8862f29f6724e70fc67c57e46.jpg"
      alt=""
    />
    <div>
      <img
        src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/7fcafee3de965b5a5e1560d019caa6c8.jpg"
        alt=""
      />
      <img
        src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/0989afa8061b0eba4910ffae6e468927.jpg"
        alt=""
      />
      <img
        src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/a96e6ba9fee3862c60f1daa0d395ce8b.jpg"
        alt=""
      />
    </div>
    <img
      src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/813b6aa9e5a0e6710909431ca3e97b85.jpg"
      alt=""
    />
    <img
      src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/f32800762fb0c301e945c629d49bd0b8.jpeg"
      alt=""
    />
    <div class="photo-box">
      <div class="box-top">
        <p>摄影学院</p>
        <div>
          <img
            v-for="(item, index) in photoss"
            :key="index"
            :src="item.imgsrc"
            alt=""
          />
          <p>共8篇内容></p>
        </div>
      </div>
      <ul class="box-bottom">
        <li v-for="(item, index) in photos" :key="index">
          <img class="imgs" :src="item.imgsrc" alt="" />
          <p class="li-p">{{ item.content }}</p>
          <div class="bottom-box">
            <div class="box-l">
              <img :src="item.imgsrcs" alt="" />
              <p>{{ item.name }}</p>
            </div>
            <div class="box-r">
              <div></div>
              <p>{{ item.num }}</p>
            </div>
          </div>
        </li>
        <li class="bottom-ck">查看更多></li>
      </ul>
    </div>
  </div>
</template>
<script>
import instance from "../../../api/request";
import Banners from "../Banners.vue";
export default {
  name: "photo",
  data() {
    return {
      data: null,
      photos: null,
      photoss: null,
    };
  },
  components: {
    Banners,
  },
  methods: {
    async fn() {
      let { data } = await instance.get("index.json");
      let micircle = data.micircle;
      let photosmall = micircle.photosmall;
      this.data = photosmall.map((item) => {
        return item.imgsrc;
      });
      let photos = micircle.photos;
      let photoss = micircle.photoss;
      this.photos = photos;
      this.photoss = photoss;
    },
  },
  created() {
    this.fn();
  },
};
</script>
<style scoped lang="less">
.photo {
  width: 7.2rem;
  height: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  background: rgb(14, 15, 14);
  color: rgb(255, 255, 255);
  img {
    width: 100%;
    vertical-align: middle;
    height: auto;
    margin: 0 auto -1px;
  }
  .small {
    width: 7.2rem;
    height: 4.2rem;
  }
  .photo-box {
    padding: 0.32rem 0.1rem;
    .box-top {
      margin-top: -0.32rem;
      height: 1.16rem;
      padding: 0 0.06rem;
      font-size: 0.32rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      p {
        width: 60%;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }
      div {
        display: flex;
        align-items: center;
        img {
          width: 0.32rem;
          height: 0.32rem;
          border-radius: 50%;
          border: 1px solid #fff;
          overflow: hidden;
        }
        p {
          font-size: 0.2rem;
          margin-left: 0.1rem;
        }
      }
    }
    .box-bottom {
      display: flex;
      align-items: center;
      overflow-x: auto;
      flex-direction: row;
      li {
        margin-right: 0.12rem;
        flex-shrink: 0;
        width: 2rem;
        margin-right: 0.12rem;
        background: #fff;
        border-radius: 0.16rem;
        display: block;
        .imgs {
          margin: 0;
          width: 100%;
          height: 1.82rem;
          border-top-left-radius: 0.16rem;
          border-top-right-radius: 0.16rem;
        }
        .li-p {
          line-height: 1em;
          height: auto;
          padding-left: 0.24rem;
          white-space: nowrap;
          margin-top: 0.2rem;
          color: #000;
          text-overflow: ellipsis;
          overflow: hidden;
        }
        .bottom-box {
          margin-top: .1rem;
          display: flex;
          height: .64rem;
          padding-left: 0.24rem;
          justify-content: space-between;
          .box-l {
            height: 0.64rem;
            font-size: 0.2rem;
            color: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            img {
              width: 0.36rem;
              height: 0.36rem;
              flex-shrink: 0;
              border-radius: 50%;
              overflow: hidden;
              margin-right: 0.1rem;
            }
            p {
              width: .4rem;
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
              font-size: .14rem;
            }
          }
          .box-r{
            display: flex;
            align-items: center;
            margin-right: .1rem;
            div{
              background: url() no-repeat;
              width: .36rem;
              height: .36rem;
              background-size: .36rem .36rem;
            }
            p{
              font-size: .14rem;
              color: rgba(0,0,0,.5);
            }
          }
        }
      }
      .bottom-ck{
        display: flex;
        width: .28rem;
        background: #fff;
        height: 2.92rem;
        padding: 0 .2rem;
        border-radius: .16rem;
        flex-direction: column;
        justify-content: center;
        font-size: .28rem;
        color: rgba(0,0,0,.5);
      }
    }
  }
}
</style>